﻿using System;
using System.Collections.Generic;
using ggHD.Domain.Repisitories;
using LinqToDB.Mapping;

namespace ggHD.Domain.BizObj
{
    [Table(Schema = "dbo", Name = "TicketHeaders")]
    public partial class TicketHeader : IEntity<int>
    {
        [PrimaryKey, Identity]
        public long Id { get; set; } // bigint
        [Column, NotNull]
        public DateTime DateCreate { get; set; } // datetime
        [Column, NotNull]
        public string Header { get; set; } // nvarchar(512)
        [Column, Nullable]
        public int? InitiatorID { get; set; } // int
        [Column, Nullable]
        public string CustomerID { get; set; } // nvarchar(256)
        [Column, NotNull]
        public long RawMailId { get; set; } // bigint

        [Column("Id"), Identity]
        public int Key { get; set; }
       
        /// <summary>
        /// FK_TicketHdr_Initiator
        /// </summary>
        [Association(ThisKey = "InitiatorID", OtherKey = "Id", CanBeNull = true)]
        public ExternalInitiator Initiator { get; set; }
    }
}